package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;

@Entity
public class Productside {
    private int prsId;
    private BigDecimal prsPrice;
    private Integer prsNumber;
    private BigDecimal prsFactoryPrice;
    /*private Deliverydetails deliverydetailsByDetaId;*/
    /*private Exchangedetails exchangedetailsByExcdId;
    private Orderdetails orderdetailsByOdetailsId;*/
    /*private OfferDetails offerDetailsByDetailsId;
    private Returnorderdetails returnorderdetailsByRodId;*/
    private Products products;
    private Specifications specificationsByspeId;

    @ManyToOne
    @JoinColumn(name="Spe_id",referencedColumnName = "Spe_id")
    public Specifications getSpecificationsByspeId() {
        return specificationsByspeId;
    }

    public void setSpecificationsByspeId(Specifications specificationsByspeId) {
        this.specificationsByspeId = specificationsByspeId;
    }

    @ManyToOne
    @JoinColumn(name="Prs_prid",referencedColumnName = "Pr_id")
    public Products getProducts() {
        return products;
    }

    public void setProducts(Products products) {
        this.products = products;
    }

    @Id
    @Column(name = "Prs_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getPrsId() {
        return prsId;
    }

    public void setPrsId(int prsId) {
        this.prsId = prsId;
    }

    @Basic
    @Column(name = "Prs_price")
    public BigDecimal getPrsPrice() {
        return prsPrice;
    }

    public void setPrsPrice(BigDecimal prsPrice) {
        this.prsPrice = prsPrice;
    }

    @Basic
    @Column(name = "Prs_number")
    public Integer getPrsNumber() {
        return prsNumber;
    }

    public void setPrsNumber(Integer prsNumber) {
        this.prsNumber = prsNumber;
    }

    @Basic
    @Column(name = "Prs_factory_price")
    public BigDecimal getPrsFactoryPrice() {
        return prsFactoryPrice;
    }

    public void setPrsFactoryPrice(BigDecimal prsFactoryPrice) {
        this.prsFactoryPrice = prsFactoryPrice;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Productside that = (Productside) o;
        return prsId == that.prsId &&
                Objects.equals(prsPrice, that.prsPrice) &&
                Objects.equals(prsNumber, that.prsNumber);
    }

    @Override
    public int hashCode() {
        return Objects.hash(prsId, prsPrice, prsNumber);
    }

    /*@ManyToOne
    @JoinColumn(name = "deta_id", referencedColumnName = "deta_id")
    public Deliverydetails getDeliverydetailsByDetaId() {
        return deliverydetailsByDetaId;
    }

    public void setDeliverydetailsByDetaId(Deliverydetails deliverydetailsByDetaId) {
        this.deliverydetailsByDetaId = deliverydetailsByDetaId;
    }*/

    /*@ManyToOne
    @JoinColumn(name = "excd_id", referencedColumnName = "excd_id")
    public Exchangedetails getExchangedetailsByExcdId() {
        return exchangedetailsByExcdId;
    }

    public void setExchangedetailsByExcdId(Exchangedetails exchangedetailsByExcdId) {
        this.exchangedetailsByExcdId = exchangedetailsByExcdId;
    }

    @ManyToOne
    @JoinColumn(name = "odetails_id", referencedColumnName = "odetails_id")
    public Orderdetails getOrderdetailsByOdetailsId() {
        return orderdetailsByOdetailsId;
    }

    public void setOrderdetailsByOdetailsId(Orderdetails orderdetailsByOdetailsId) {
        this.orderdetailsByOdetailsId = orderdetailsByOdetailsId;
    }*/

    /*@ManyToOne
    @JoinColumn(name = "details_id", referencedColumnName = "details_id")
    public OfferDetails getOfferDetailsByDetailsId() {
        return offerDetailsByDetailsId;
    }

    public void setOfferDetailsByDetailsId(OfferDetails offerDetailsByDetailsId) {
        this.offerDetailsByDetailsId = offerDetailsByDetailsId;
    }

    @ManyToOne
    @JoinColumn(name = "rod_id", referencedColumnName = "rod_id")
    public Returnorderdetails getReturnorderdetailsByRodId() {
        return returnorderdetailsByRodId;
    }

    public void setReturnorderdetailsByRodId(Returnorderdetails returnorderdetailsByRodId) {
        this.returnorderdetailsByRodId = returnorderdetailsByRodId;
    }*/

    @Override
    public String toString() {
        return "Productside{" +
                "prsId=" + prsId +
                ", prsPrice=" + prsPrice +
                ", prsNumber=" + prsNumber +
                ", prsFactoryPrice=" + prsFactoryPrice +
                '}';
    }
}
